const columns = (FormModal, AuthModal, onRemove, namespace) => {
    return [
        {
            type: 'selection',
            title: '#',
            width: 50
        },
        {
            type: 'index',
            width: 60,
            align: 'center'
        },
        {
            title: '角色名称',
            key: 'name',
            width: 180
        },
        {
            title: '角色标识',
            key: 'role',
            width: 180
        },
        {
            title: '描述',
            // width:180,
            key: 'description'
        },
        {
            title: '创建日期',
            key: 'ctime',
            width: 180
        },
        {
            title: '维护日期',
            key: 'mtime',
            width: 180
        },
        {
            title: '操作',
            key: 'operation',
            width: 170,
            render: (h, { row, column, index }) => {
                return h('div', [
                    h(AuthModal, {
                        props: {
                            record: row,
                            namespace
                        }
                    }, [
                      h('IButton', {
                        props: {
                          type: 'text',
                          size: 'small',
                          perm:'role:allot'
                        }
                      },'授权')
                    ]),
                    h(FormModal, {
                        props: {
                            title: '编辑权限',
                            record: row,
                            option: 'update',
                            namespace,
                            type: 'text',
                            size: 'small',
                            perm: 'role:update'
                        }
                    },'编辑'),
                    h('IButton', {
                        props: {
                            type: 'text',
                            size: 'small',
                            perm: 'role:remove',
                            click: true
                        },
                        on: {
                            click: () => onRemove(row.id)
                        }
                    }, '删除')
                ]);
            }
        }
    ]
}

export default columns;
